package com.example.pest.bean;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class PTResult <D>{
    private int code;
    private String msg;
    private D data;

    public static  PTResult ok(){
        return new PTResult(0, "成功", null);
    }
    public static  PTResult ok(Object d){
        return new PTResult(0, "成功", d);
    }

    public static  PTResult error(String msg){
        return new PTResult(1004, msg, null);
    }
}
